package me.zhengjie.modules.thumbnail.service;

import me.zhengjie.base.PageInfo;
import me.zhengjie.base.CommonService;
import me.zhengjie.modules.thumbnail.domain.Thumbnail;
import me.zhengjie.modules.thumbnail.domain.vo.ThumbnailVo;
import me.zhengjie.modules.thumbnail.service.dto.ThumbnailDto;
import me.zhengjie.modules.thumbnail.service.dto.ThumbnailQueryParam;
import org.springframework.data.domain.Pageable;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Set;

/**
* @author TianI
* @date 2022-02-14
*/
public interface ThumbnailService extends CommonService<Thumbnail>  {

    static final String CACHE_KEY = "thumbnail";

    /**
    * 查询数据分页
    * @param query 条件
    * @param pageable 分页参数
    * @return PageInfo<ThumbnailDto>
    */
    PageInfo<ThumbnailDto> queryAll(ThumbnailQueryParam query, Pageable pageable);

    /**
    * 查询所有数据不分页
    * @param query 条件参数
    * @return List<ThumbnailDto>
    */
    List<ThumbnailDto> queryAll(ThumbnailQueryParam query);

    Thumbnail getById(Long id);
    ThumbnailDto findById(Long id);

    /**
     * 插入一条新数据。
     */
    int insert(ThumbnailDto resources);
    int updateById(ThumbnailDto resources);
    int removeById(Long id);
    int removeByIds(Set<Long> ids);

    Thumbnail create(MultipartFile file);

    List<ThumbnailVo> queryThumbnail(Long id);

    List<ThumbnailVo> getByName(String name);




    /**
    * 导出数据
    * @param all 待导出的数据
    * @param response /
    * @throws IOException /
    */
    // void download(List<ThumbnailDto> all, HttpServletResponse response) throws IOException;
}
